<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<% 

String p_type=request.getParameter("type");
String p_name=request.getParameter("project_name");
String p_sdate=request.getParameter("start_date");
String p_edate=request.getParameter("end_date");
String p_priority=request.getParameter("priority");
String p_c=request.getParameter("status");
String p_client=request.getParameter("client_name");
//int p_id=Integer.parseInt(p_i);
//int p_completed=Integer.parseInt(p_c);

%>
<%
String query="insert into project(name,client,start_date,estimated_date,type,priority,completed) values('"+p_name+"','"+p_client+"','"+p_sdate+"','"+p_edate+"','"+p_type+"','"+p_priority+"','"+p_c+"')";

Connection db_conn = null;
Statement statement = null;
PreparedStatement pstmt;
ResultSet rs;
try{
Class.forName("com.mysql.jdbc.Driver");
String url= "jdbc:mysql://localhost:3306/db";
db_conn = DriverManager.getConnection( url,"root", "root" );
statement = db_conn.createStatement();
statement.executeUpdate(query);

db_conn.close();
} catch(SQLException e){
e.printStackTrace();
out.println("sql not found");
out.println(e);
} catch(ClassNotFoundException e){
e.printStackTrace();
out.println(e);
}
%>            



